
package vistas;

import controladores.controlador_consulta;
import java.util.Vector;
import javax.swing.table.DefaultTableModel;


public class vistas_consultas extends javax.swing.JFrame {

    public DefaultTableModel tablemodel= new DefaultTableModel();
    public DefaultTableModel tablemodel2= new DefaultTableModel();
        controlador_consulta listen;
    /** Creates new form vistas_consultas */
    public vistas_consultas() {
        initComponents();
        listen_botones();
        tabla();
    }

        public final  void listen_botones()
    {
         listen = new controlador_consulta(this);
        btnReporte2.addActionListener (listen);
        btnReporte2.setActionCommand("reporte1");
        btnReporte.addActionListener(listen);
        btnReporte.setActionCommand("reporte2");
       
    }
       public void tabla()
    {
         tablemodel= new DefaultTableModel();
         jTableProductos.setModel(tablemodel);
         Vector<String> datos  = new Vector<String>();
         datos.add("producto");
         datos.add("cantidad");
         datos.add("precio");
         tablemodel.setColumnIdentifiers(datos);

         tablemodel2= new DefaultTableModel();
         jTableIngredientes.setModel(tablemodel2);
         Vector<String> datos2  = new Vector<String>();
         datos2.add("Ingrediente");
         datos2.add("cantidad");
         tablemodel2.setColumnIdentifiers(datos2);
    }


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTableProductos = new javax.swing.JTable();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTableIngredientes = new javax.swing.JTable();
        btnReporte = new javax.swing.JButton();
        btnReporte2 = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Reporte de datos");
        getContentPane().setLayout(null);

        jTableProductos.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTableProductos);

        getContentPane().add(jScrollPane1);
        jScrollPane1.setBounds(240, 240, 452, 190);

        jTableIngredientes.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(jTableIngredientes);

        getContentPane().add(jScrollPane2);
        jScrollPane2.setBounds(240, 10, 452, 210);

        btnReporte.setText("reporte");
        getContentPane().add(btnReporte);
        btnReporte.setBounds(20, 70, 110, 40);

        btnReporte2.setText("reporte");
        getContentPane().add(btnReporte2);
        btnReporte2.setBounds(20, 280, 110, 40);

        jLabel1.setText("Ventas de Productos");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(20, 240, 180, 40);

        jLabel2.setText("Ingredientes");
        getContentPane().add(jLabel2);
        jLabel2.setBounds(20, 20, 170, 40);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-706)/2, (screenSize.height-473)/2, 706, 473);
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new vistas_consultas().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnReporte;
    private javax.swing.JButton btnReporte2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTable jTableIngredientes;
    private javax.swing.JTable jTableProductos;
    // End of variables declaration//GEN-END:variables

}
